package cn.wonderland.org.dto;

import cn.wonderland.org.domain.Shop;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ShopDto {

    /*店铺名字*/
   @NotBlank(message = "店铺名字不能为空！")
   private String name;
   /*座机号码*/
   @NotBlank(message = "座机号码不能为空！")
   private String tel;
   /*店铺地址*/
   @NotBlank(message = "店铺地址不能为空！")
   private String address;
   /*店铺图标*/
   private String logo;

   /*管理员*/
   private AdminDto admin;

   public Shop getShop() {
     return Shop.builder()
             .state(0)
             .address(this.address)
             .logo(this.logo)
             .registerTime(new Date())
             .tel(this.tel)
             .name(this.name)
             .build();
   }
}
